package cn.kgc.entity;

import com.baomidou.mybatisplus.annotation.*;
import com.baomidou.mybatisplus.extension.activerecord.Model;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.fasterxml.jackson.annotation.JsonInclude;
import lombok.*;

import java.io.Serializable;
import java.util.Date;

/**
 * @author example
 * @version 1.0
 */
@Setter
@Getter
@AllArgsConstructor
@NoArgsConstructor
@Builder
@TableName(value = "loginfo")
@JsonInclude(value = JsonInclude.Include.ALWAYS)
@SuppressWarnings("all")
public class Loginfo extends Model<Loginfo> implements Serializable {

    /**
     * 主键
     */
    @TableId(type = IdType.AUTO)
    private Long id;

    /**
     * 日志类型(1操作日志 2登录/退出日志 3定时任务日志)
     */
    @TableField(value = "log_type")
    private String logType;

    /**
     * 模块名称
     */
    @TableField(value = "module_name")
    private String moduleName;

    /**
     * 日志内容
     */
    @TableField(value = "log_content")
    private String logContent;

    /**
     * 方法名
     */
    @TableField(value = "method_name")
    private String methodName;

    /**
     * 日志操作类型(新增 删除 修改 查询 其它)
     */
    @TableField(value = "operate_type")
    private String operateType;

    /**
     * 用户id
     */
    @TableField(value = "user_id")
    private Long userId;

    /**
     * 接口执行的时长(1s)
     */
    @TableField(value = "cost_time")
    private Integer costTime;

    /**
     * 接口执行的日期(2025-10-05 08:00:00)
     */
    @TableField(value = "creation_date",fill = FieldFill.INSERT)
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
    private Date creationDate;
}